import { axios } from '@/utils/request'
import config from '@/config/appConfig'
import querystring from 'querystring'

// 运费模板
export function getAllFreightTemplate () {
  return axios({
    url: config.url,
    method: 'get',
    params: {
      _gp: 'admin.freight',
      _mt: 'getAllFreightTemplate'
    }
  })
}

//新增
export function addFreightTemplate (parameter) {
  return axios({
    url: config.url,
    method: 'post',
    data:querystring.stringify({
      _gp: 'admin.freight',
      _mt: 'addFreightTemplate',
      ...parameter
    })
  })
}

//编辑
export function updateFreightTemplate (parameter) {
  return axios({
    url: config.url,
    method: 'post',
    data:querystring.stringify({
      _gp: 'admin.freight',
      _mt: 'updateFreightTemplate',
      ...parameter
    })
  })
}

export function deleteFreightTemplate (parameter) {
  return axios({
    url: config.url,
    method: 'post',
    data:querystring.stringify({
      _gp: 'admin.freight',
      _mt: 'deleteFreightTemplate',
      ... parameter
    })
  })
}